package cn.iocoder.yudao.module.promotion.gift.api;

import cn.iocoder.yudao.module.api.promotion.gift.GiftActivityApi;
import cn.iocoder.yudao.module.api.promotion.gift.dto.GiftActivityVO;
import cn.iocoder.yudao.module.promotion.gift.service.app.AppGiftActivityService;
import cn.iocoder.yudao.module.promotion.gift.service.core.CoreGiftRecordService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;

import java.util.Collection;
import java.util.List;
import java.util.Map;

/**
 * <pre>
 * OOoO0OOoO0OOOooo0oOOOO0OOOOO0oooOO0ooOOO0Ooooo0OOOOo0ooooO0OOooo0Ooooo0OOOOO
 *  这里是文件说明
 * OOoO0OOoO0OOOooo0oOOOO0OOOOO0oooOO0ooOOO0Ooooo0OOOOo0ooooO0OOooo0Ooooo0OOOOO
 * </pre>
 *
 * @author 山野羡民（1032694760@qq.com）
 * @since 2025/01/13
 */
@Service
@Validated
public class GiftActivityApiImpl implements GiftActivityApi {
    @Resource
    private AppGiftActivityService appGiftActivityService;
    @Resource
    private CoreGiftRecordService coreGiftRecordService;

    @Override
    public GiftActivityVO getDetail(Long id) {
        return appGiftActivityService.getDetail(id);
    }

    @Override
    public Map<Long, Integer> countReceived(Long userId, Collection<Long> giftActivityIds) {
        return coreGiftRecordService.getTakenCount(userId, giftActivityIds);
    }

    @Override
    public List<GiftActivityVO> getList(Collection<Long> ids) {
        return appGiftActivityService.getList(ids);
    }

}
